﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.ComponentModel;
using System.Text;
using Global.Class.Library;

namespace DataTransferObject.MetaDataList
{
    public class ListSalesmenNameMaster : NotifyPropertyChangeObject
    {
        private int salesmenID;

        private DateTime entryDate;
        private DateTime birthday;
        private DateTime hiredDate;
        
        private int salesmenCategoryID;
        private int salesmenTypeID;
        private int salesmenTitleID;

        private string description;
        private string descriptionZUL;
        private string descriptionDEI;
        private string descriptionOfficial;
        private string descriptionOriginal;
        private string descriptionLastName;
        private string jobTitle;
        private string residentAddress;
        private string identifyNumber;
        private string securityID;
        private string telephone;
        private string other;
        private string email;
        private string employeePicture;                  
        
        private bool female;
        private bool married;
        private bool inActive;                
        private bool salesmenCommodityAll;
        
        

        public ListSalesmenNameMaster()
        {
            GlobalDefaultValue.Apply(this);
            this.EntryDate = DateTime.Now;
        }

        #region Properties


        [DefaultValue(-1)]
        public int SalesmenID
        {
            get { return this.salesmenID; }
            set { ApplyPropertyChange<ListSalesmenNameMaster, int>(ref this.salesmenID, o => o.SalesmenID, value); }
        }

        [DefaultValue(typeof(DateTime), "01/01/1900")]
        public DateTime EntryDate
        {
            get { return this.entryDate; }
            set { ApplyPropertyChange<ListSalesmenNameMaster, DateTime>(ref this.entryDate, o => o.EntryDate, value); }
        }

        [DefaultValue(typeof(DateTime), "01/01/1900")]
        public DateTime Birthday
        {
            get { return this.birthday; }
            set { ApplyPropertyChange<ListSalesmenNameMaster, DateTime>(ref this.birthday, o => o.Birthday, value); }
        }

        [DefaultValue(typeof(DateTime), "01/01/1900")]
        public DateTime HiredDate
        {
            get { return this.hiredDate; }
            set { ApplyPropertyChange<ListSalesmenNameMaster, DateTime>(ref this.hiredDate, o => o.HiredDate, value); }
        }

        //[DefaultValue(-1)]
        public int SalesmenCategoryID
        {
            get { return this.salesmenCategoryID; }
            set { ApplyPropertyChange<ListSalesmenNameMaster, int>(ref this.salesmenCategoryID, o => o.SalesmenCategoryID, value); }
        }

        //[DefaultValue(-1)]
        public int SalesmenTypeID
        {
            get { return this.salesmenTypeID; }
            set { ApplyPropertyChange<ListSalesmenNameMaster, int>(ref this.salesmenTypeID, o => o.SalesmenTypeID, value); }
        }

        //[DefaultValue(-1)]
        public int SalesmenTitleID
        {
            get { return this.salesmenTitleID; }
            set { ApplyPropertyChange<ListSalesmenNameMaster, int>(ref this.salesmenTitleID, o => o.SalesmenTitleID, value); }
        }

        
        [DefaultValue("")]
        public string Description
        {
            get { return this.description; }
            set { ApplyPropertyChange<ListSalesmenNameMaster, string>(ref this.description, o => o.Description, value); }
        }


        [DefaultValue("")]
        public string DescriptionZUL
        {
            get { return this.descriptionZUL; }
            set { ApplyPropertyChange<ListSalesmenNameMaster, string>(ref this.descriptionZUL, o => o.DescriptionZUL, value); }
        }

        [DefaultValue("")]
        public string DescriptionDEI
        {
            get { return this.descriptionDEI; }
            set { ApplyPropertyChange<ListSalesmenNameMaster, string>(ref this.descriptionDEI, o => o.DescriptionDEI, value); }
        }

        [DefaultValue("")]
        public string DescriptionOfficial
        {
            get { return this.descriptionOfficial; }
            set { ApplyPropertyChange<ListSalesmenNameMaster, string>(ref this.descriptionOfficial, o => o.DescriptionOfficial, value); }
        }

        [DefaultValue("")]
        public string DescriptionOriginal
        {
            get { return this.descriptionOriginal; }
            set { ApplyPropertyChange<ListSalesmenNameMaster, string>(ref this.descriptionOriginal, o => o.DescriptionOriginal, value); }
        }

        [DefaultValue("")]
        public string DescriptionLastName
        {
            get { return this.descriptionLastName; }
            set { ApplyPropertyChange<ListSalesmenNameMaster, string>(ref this.descriptionLastName, o => o.DescriptionLastName, value); }
        }

        [DefaultValue("")]
        public string JobTitle
        {
            get { return this.jobTitle; }
            set { ApplyPropertyChange<ListSalesmenNameMaster, string>(ref this.jobTitle, o => o.JobTitle, value); }
        }


        [DefaultValue("")]
        public string ResidentAddress
        {
            get { return this.residentAddress; }
            set { ApplyPropertyChange<ListSalesmenNameMaster, string>(ref this.residentAddress, o => o.ResidentAddress, value); }
        }       

        [DefaultValue("")]
        public string IdentifyNumber
        {
            get { return this.identifyNumber; }
            set { ApplyPropertyChange<ListSalesmenNameMaster, string>(ref this.identifyNumber, o => o.IdentifyNumber, value); }
        }

        [DefaultValue("")]
        public string SecurityID
        {
            get { return this.securityID; }
            set { ApplyPropertyChange<ListSalesmenNameMaster, string>(ref this.securityID, o => o.SecurityID, value); }
        }

        [DefaultValue("")]
        public string Telephone
        {
            get { return this.telephone; }
            set { ApplyPropertyChange<ListSalesmenNameMaster, string>(ref this.telephone, o => o.Telephone, value); }
        }

        [DefaultValue("")]
        public string Other
        {
            get { return this.other; }
            set { ApplyPropertyChange<ListSalesmenNameMaster, string>(ref this.other, o => o.Other, value); }
        }

        [DefaultValue("")]
        public string EMail
        {
            get { return this.email; }
            set { ApplyPropertyChange<ListSalesmenNameMaster, string>(ref this.email, o => o.EMail, value); }
        }

        [DefaultValue("")]
        public string EmployeePicture
        {
            get { return this.employeePicture; }
            set { ApplyPropertyChange<ListSalesmenNameMaster, string>(ref this.employeePicture, o => o.EmployeePicture, value); }
        }

        [DefaultValue(false)]
        public bool Female
        {
            get { return this.female; }
            set { ApplyPropertyChange<ListSalesmenNameMaster, bool>(ref this.female, o => o.Female, value); }
        }

        [DefaultValue(false)]
        public bool Married
        {
            get { return this.married; }
            set { ApplyPropertyChange<ListSalesmenNameMaster, bool>(ref this.married, o => o.Married, value); }
        }

        [DefaultValue(false)]
        public bool InActive
        {
            get { return this.inActive; }
            set { ApplyPropertyChange<ListSalesmenNameMaster, bool>(ref this.inActive, o => o.InActive, value); }
        }

        [DefaultValue(false)]
        public bool SalesmenCommodityAll
        {
            get { return this.salesmenCommodityAll; }
            set { ApplyPropertyChange<ListSalesmenNameMaster, bool>(ref this.salesmenCommodityAll, o => o.SalesmenCommodityAll, value); }
        }

        
        #endregion

        protected override System.Collections.Generic.List<ValidationRule> CreateRules()
        {
            List<ValidationRule> validationRules = base.CreateRules();
            validationRules.Add(new SimpleValidationRule("Description", "Reference cannot be blank.", delegate { return this.Description.Length != 0; }));
            validationRules.Add(new SimpleValidationRule("DescriptionOfficial", "Reference cannot be blank.", delegate { return this.DescriptionOfficial.Length != 0; }));
            validationRules.Add(new SimpleValidationRule("DescriptionLastName", "Reference cannot be blank.", delegate { return this.DescriptionLastName.Length != 0; }));

            validationRules.Add(new SimpleValidationRule("SalesmenCategoryID", "Category cannot be empty.", delegate { return this.SalesmenCategoryID > 0; }));
            validationRules.Add(new SimpleValidationRule("SalesmenTypeID", "Type cannot be empty.", delegate { return this.SalesmenTypeID > 0; }));
            validationRules.Add(new SimpleValidationRule("SalesmenTitleID", "Title cannot be empty.", delegate { return this.SalesmenTitleID > 0; }));

            return validationRules;
        }
    }
}
